package com.example.springbatchdemo.config.listener;

import org.springframework.batch.core.annotation.AfterChunk;
import org.springframework.batch.core.annotation.BeforeChunk;
import org.springframework.batch.core.scope.context.ChunkContext;
import org.springframework.context.annotation.Configuration;

/**
 * @Classname MyChunkLinster
 * @Description TODO
 * @Date 2020/9/19 14:24
 * @Created by kevin
 */
@Configuration
public class MyChunkLinster {

    @BeforeChunk
    public void beforeChunk( ChunkContext context ) {
        System.out.println(context.getStepContext().getStepName() + "before......");

    }


    @AfterChunk
    public void afterChunk( ChunkContext context ) {
        System.out.println(context.getStepContext().getStepName() + "after......");

    }

}
